<?php
//exec('C:/PROGRA~1/Adobe/READER~1.0/Reader/AcroRd32.exe /t "D:/http___www.sfcservice.pdf" "Zebra TLP2844"');
function print_file($filename)
{
  // path to your adobe executable
  $adobe_path='"C:/PROGRA~1/Adobe/READER~1.0/Reader/AcroRd32.exe"';

  $ext='';
  $ext=strrchr($filename,'.');
  $ext=substr($ext,1);
  $ext_xl=substr($ext,0,2);

  if ($ext=='pdf') {
  exec ($adobe_path.' /t '.$filename);
  }
  else if ($ext=='doc'||$ext=='rtf'||$ext=='txt') {
  $word = new COM("Word.Application");
  $word->visible = true;
  $word->Documents->Open($filename);
  $word->ActiveDocument->PrintOut();
  $word->ActiveDocument->Close();
  $word->Quit();
  }
  else if ($ext_xl=='xl') {
  $excel = new COM("Excel.Application");
  $excel->visible = true;
  $excel->Workbooks->Open($filename);
  $excel->ActiveWorkBook->PrintOut();
  $excel->ActiveWorkBook->Close();
  $excel->Quit();
  }
}
print_file("D:/http___www.sfcservice.pdf");
?>